<?php

class Jnd_View_Helper_Messenger extends Zend_View_Helper_Abstract
{

    public function messenger()
    {
        if ($this->view->flashMessenger(true)->hasMessages()) {
            echo '<div class="ui-state-error ui-corner-all" style="padding:0 0.7em">';
            echo '<div style="margin:1em 0;"><span class="ui-icon ui-icon-alert" style="float:left; margin-right:0.3em"></span> ';
            foreach ($this->view->flashMessenger() as $msg) {
                if (is_array($msg))
                    echo implode('<br />', $msg);
                else
                    echo $msg;
            }
            echo '</div></div>';
        }
    }
}
